package J1_12;

import java.util.Scanner;

public class J112task1 {
    public static void main(String[] args) {
        String str;
        String s[];
        int cont=1;
        Scanner scanner =new Scanner(System.in);
        scanner.useDelimiter("\n");
        System.out.printf("请输入一个字符串:");
        str=scanner.next();
        for (int i=0;i<str.length();i++){
            if (str.charAt(i)==32){
                cont++;
            }
        }
        System.out.println(cont);
    }
}
